﻿@model IEnumerable<BeanOverflow.Models.QuestionAndResponsesModel>

@{
    ViewBag.Title = "AdminIndex";
}

<h2>Administrator View</h2>

<table>
    <tr>

        <th>
            Votes
        </th>
         <th>
            Answers
        </th>
        <th>
            Title
        </th>
        <th>
            Asked
        </th>
        <th>
            Delete
        </th>
           
            
    </tr>

@foreach (var item in Model) {
    <tr>
        
        
        <td>
            @Html.DisplayFor(modelItem => item.Question.
                Votes)
            
        </td>
        <td>
          @Html.DisplayFor(modelItem => item.Responses.ToList().Count)
        </td>
        <td>          
             @Html.ActionLink(item.Question.Title, "../QuestionAndResponsesModel/Details", new { id = item.Question.ID })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Question.CreatedDate)
        </td>
        <td>          
             @Html.ActionLink("Delete", "../Question/Delete", new { id = item.Question.ID })
        </td>
    </tr>
}

</table>
